package impl;

import java.util.ArrayList;
import java.util.Date;

import contraintes.ContrainteDispo;
import contraintes.Seance;

import interfaces.forAgents.IConstraintAccess;
import interfaces.forAgents.IPlageHoraire;
import interfaces.forAgents.ISubscriptionAccess;
import reservation.PlageHoraire;
import mysticedt.Data;

public class DataImpl extends Data {
	public class AgentSide extends Agent {

		@Override
		protected IPlageHoraire plageHoraireBooking() {
			return new IPlageHoraire() {
				
				public PlageHoraire demanderCreneau(Date limite, int dure) {
					// TODO Auto-generated method stub
					return plageHoraire().demanderCreneau(limite,dure,myRef().pull());
				}

				public boolean reserverCreneau(int idPh) {
					// TODO Auto-generated method stub
					return plageHoraire().reserverCreneau(idPh,myRef().pull());
				}
			};
		}

		@Override
		protected IConstraintAccess constraintAccess() {
			// TODO Auto-generated method stub
			return new IConstraintAccess() {
				
				public ArrayList<ContrainteDispo> getContraintesDispo() {
					// TODO Auto-generated method stub
					return pull().getContraintesDispo(myRef().pull());
				}
			};
		}

		@Override
		protected ISubscriptionAccess subscriptionAccess() {
			// TODO Auto-generated method stub
			return new ISubscriptionAccess() {
				
				public ArrayList<Seance> getListIdCoursEns() {
					// TODO Auto-generated method stub
					return pull().getListIdCoursEns(myRef().pull());
				}

				public ArrayList<Seance> getListIdCoursEtu() {
					// TODO Auto-generated method stub
					return pull().getListIdCoursEtu(myRef().pull());
				}
			};
		}
		
	}
}
